package org.gruposp2p.dnie.model.xmladapter;

import javax.xml.bind.annotation.adapters.XmlAdapter;
import org.gruposp2p.dnie.model.DNIeUser;

/**
 *
 * @author jj
 */
public class DNIeUserAdapter extends XmlAdapter<Integer, DNIeUser> {

    @Override
    public Integer marshal(DNIeUser user) throws Exception {
        return user.getId();
    }

    @Override
    public DNIeUser unmarshal(Integer id) throws Exception {
        DNIeUser user = new DNIeUser();
        user.setId(id);
        return user;
    }

}
